//
//  AppDelegate.m
//  1yqb
//
//  Created by 曲天白 on 15/12/11.
//  Copyright © 2015年 乙科网络. All rights reserved.
//

#import "Userdefault.h"

@implementation Userdefault
+(void)setUser:(NSDictionary *)name{
    NSUserDefaults *userde = [NSUserDefaults standardUserDefaults];
    [userde setObject:name forKey:@"userinfo"];
    [userde synchronize];
}
+ (NSDictionary *)getUser{
    NSUserDefaults *userde = [NSUserDefaults standardUserDefaults];
    if ([userde objectForKey:@"userinfo"] == nil) {
        return nil;
    }
    return [userde objectForKey:@"userinfo"];
}

+(void)setSearchHistory:(NSMutableArray *)history{
    
    NSUserDefaults *userde = [NSUserDefaults standardUserDefaults];
    [userde setObject:history forKey:@"SearchHistory"];
    [userde synchronize];
}

+(NSMutableArray *)getSearchHistory{
    NSUserDefaults *userde = [NSUserDefaults standardUserDefaults];
    if ([userde objectForKey:@"SearchHistory"] == nil) {
        return nil;
    }
    return [userde objectForKey:@"SearchHistory"];
    
}

@end
